<#include "/@inc/funcMacros.ftl"> 
<#include "/@inc/copyright.txt">
<#assign baseName = TriaGram + "UtlLogger">
<#assign className = TriaGram + baseName + "Macros">
<@pp.renameOutputFile name=className+".h">
</@pp.renameOutputFile>
#ifndef ${className}_H
#define ${className}_H

#include "${baseName}.h"
#include <iostream>

// Call ONCE in the application. Logging starts only after this code is executed.
#define ${TriaGram}_LOG_INIT( options )  ${baseName}::Init( options ) ;

// At the begining of any function whose logging is to be enabled.
#define ${TriaGram}_LOG_FUNC(iText) ${baseName} log(iText) ;

// First the text without any preceding tabs
#define ${TriaGram}_LOG_STREAM(option, index, iText) if(option & ${baseName}::_options){ log.GetStream(index)<<"\n"<<iText; }

// First prints tabs and then the text
#define ${TriaGram}_LOG_TAB_STREAM(option, index, iText) if(option & ${baseName}::_options){ log.PrintTabs(index); log.GetStream(index)<<iText; }

#define ${TriaGram}_LOG(iText)	${TriaGram}_LOG_TAB_STREAM( ${baseName}File , 0, iText ) \
						${TriaGram}_LOG_TAB_STREAM( ${baseName}Cout , -1, iText ) 

#define ${TriaGram}_LOG_WARN(iText)		${TriaGram}_LOG_STREAM( ${baseName}Warn, 1, iText) ${TriaGram}_LOG( "Line: " << __LINE__ << " : " << iText) 

#define ${TriaGram}_LOG_ERROR(iText)	${TriaGram}_LOG_STREAM( ${baseName}Error, 2, iText) ${TriaGram}_LOG(__FILE__ << ":" << iText)  

#endif
